package com.sali.design_pattern.h_proxy_pattern.lesson_03_02;


import com.sali.design_pattern.h_proxy_pattern.lesson_03_02.service.Order5ServiceImpl;
import com.sali.design_pattern.h_proxy_pattern.lesson_03_02.service.TicketServiceImpl;

/**
 * @description:
 * @date: 2023/3/19 21:53.
 * @version: 1.0
 */
public class Test {

    public static void main(String[] args) {
        // 代理类
        LogProxy logProxy = new LogProxy();
        // 代理类具体的实现类
        Order5ServiceImpl proxy = (Order5ServiceImpl) logProxy.getProxy(Order5ServiceImpl.class);
        // 代理类执行方法（jdk动态代理在底层会进行处理和织入）
        proxy.buyTicket();

        System.out.println("=====");

        LogProxy logProxy2 = new LogProxy();
        TicketServiceImpl proxy2 = (TicketServiceImpl) logProxy2.getProxy(TicketServiceImpl.class);
        proxy2.getTicket(1);

    }

}
